<template>
  <div class="app-container">
    <div class="top">
      <div class="left"><img src="@/assets/images/icon/leftIcon.png" alt="" srcset=""
          style="width: 15px;height: 14px;">素材库编辑</div>
      <!-- <div class="right"><el-button type="primary" size="mini" @click="handleQuery">下达</el-button> -->
    </div>
    <div>
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="120px">
        <el-form-item label="请输入搜索内容：" prop="ipaddr" label-width="130px">
          <el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item label="一级指标：" prop="userName">
          <el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable @keyup.enter.native="handleQuery"
            aria-disabled="true" />
        </el-form-item>
        <el-form-item label="二级指标：" prop="userName">
          <el-input v-model="queryParams.ipaddr" placeholder="素材库名称" clearable @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script>
import { list, forceLogout } from "@/api/monitor/online";

export default {
  name: "Online",
  data() {
    return {
      dialogFormVisible: false,
      form: {
        name: '',
        region: '',
        date1: '',
        date2: '',
        delivery: false,
        type: [],
        resource: '',
        desc: ''
      },
      formLabelWidth: '120px',
      // 遮罩层
      loading: true,
      // 总条数
      total: 0,
      // 表格数据
      list: [],
      pageNum: 1,
      pageSize: 10,
      // 查询参数
      queryParams: {
        ipaddr: undefined,
        userName: undefined
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询登录日志列表 */
    getList() {
      this.loading = true;
      list(this.queryParams).then(response => {
        this.list = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    /** 强退按钮操作 */
    handleForceLogout(row) {
      this.$router.push({
        path: '/assignment/details'
      })
      // this.$modal.confirm('是否确认强退名称为"' + row.userName + '"的用户？').then(function () {
      //   return forceLogout(row.tokenId);
      // }).then(() => {
      //   this.getList();
      //   this.$modal.msgSuccess("强退成功");
      // }).catch(() => { });
    }
  }
};
</script>
<style scoped lang="scss">
.title {
  display: flex;
  color: #A9A9AA;

  .active {
    color: #157DFA;
  }

  .step1 {
    margin-right: 10px;
  }

  span {
    margin-right: 8px;
  }
}

.top {
  display: flex;
  justify-content: space-between;
  color: #333;
  margin: 15px 0;

  .left {
    img {
      margin-right: 10px;
    }
  }

  .right {}
}
</style>
